﻿namespace StepsManagerLibrary.Interfaces
{
    /// <summary>
    /// Object that keeps a record of observers and notify them
    /// that a change has occured
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public interface IObservable<T>
    {
        /// <summary>
        /// Attach an observer to the observed object
        /// </summary>
        /// <param name="observer">Observer to add</param>
        void Attach(IObserver<T> observer);

        /// <summary>
        /// Detach an observer to the observed object
        /// </summary>
        /// <param name="observer">Observer to detatch</param>
        void Detach(IObserver<T> observer);

        /// <summary>
        /// Notify the Observers that an update occured
        /// </summary>
        /// <param name="notification">
        /// Information that you want to be passed
        /// </param>
        void Notify(T notification);
    }
}
